#include <iostream>
#include <string>
using namespace std;
/*
// 简单的字符串匹配 时间复杂度O(M*N)
int CutStr(string& str, string& s){
    int cnt = 0;
    bool flag = true;
    for(int i = 0; i < str.size(); ){
        for(int j = 0; j < s.size(); ){
            if(str[i] == s[j]){
                ++i, ++j;
                flag = true;
            }
            else{
                ++i;
                flag = false;
                break;
            }
        }
        if(flag == true)
            ++cnt;
    }
    return cnt;
}
*/

int main()
{
    string str, s;
    while(cin >> str >> s){
        // cout << CutStr(str, s) << endl;
        
        /*
        // 方法二：string::find
        int cnt = 0;
        size_t pos = 0;
        // 在 str 中找 s 
        while((pos = str.find(s, pos)) != string::npos){
            pos += s.size();
            ++cnt;
        }
        cout << cnt << endl;*/
        
        // 方法三
        int cnt = 0;
        while (str.find(s) != string::npos){
            ++cnt;
            str.erase(str.find(s), s.size());
        }
        cout << cnt << endl;
    }
    return 0;
}